<?php

namespace App\Jobs;

use App\Wen\Utils\GatewayUtils;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class AppPushJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    protected $way = 'single';
    protected $title = '';
    protected $content = '';
    protected $payload = '';
    protected $cids = [];
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($title, $content, $payload, $cids, $way)
    {
        $this->title = $title;
        $this->content = $content;
        $this->payload = $payload;
        $this->cids = $cids;
        $this->way = $way;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        GatewayUtils::app_push($this->title, $this->content, $this->payload, $this->cids, $this->way);
    }
}
